package com.github.pig.sales.controller;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.github.pig.admin.service.SysDeptService;
import com.github.pig.admin.service.SysUserService;
import com.github.pig.common.constant.CommonConstant;
import com.github.pig.common.util.Query;
import com.github.pig.common.vo.UserVO;
import com.github.pig.sales.service.ISalesFollowUpTeamService;
import com.github.pig.training.entity.TrainingStudent;
import com.github.pig.training.service.ITrainingStudentService;
import org.reflections.util.Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/salesIntentionCustomer")
public class SalesIntentionCustomerController {

    @Autowired
    private ITrainingStudentService trainingStudentService;

    @Autowired
    private SysUserService userService;

    /**
     * 分页查询信息
     *
     * @param params 分页对象
     * @return 分页对象
     */
    @RequestMapping("/page")
    public Page page(@RequestParam Map<String, Object> params, UserVO user) {
        params.put("userId",userService.findUserByUsername(user.getUsername()).getUserId());
        return trainingStudentService.selectPage(new Query<>(params), trainingStudentService.getEwByCondition(params));
    }

    /**
     *   定时检查跟进天数是否大于最大天数
     */
//    @RequestMapping("/checkDayNum")
//    public void checkDayNum(){
//        trainingStudentService.checkDayNum();
//    }


}
